package com.example.mybackend.mapper;

import com.example.mybackend.entity.user;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface userMapper {
    @Select("SELECT * FROM user")
    List<user> selectAll();

    @Update("UPDATE user SET status = 0 WHERE id =#{id}")
    Integer updateStatusTo0(Integer id);

    @Update("UPDATE user SET status = 1 WHERE id =#{id}")
    Integer updateStatusTo1(Integer id);

    @Update("UPDATE user SET username=#{username},password=#{password} WHERE id =#{id}")
    Integer updateUser(user User);
}
